package com.haois.mp.database.module.common.dao;


import com.haois.mp.database.module.basic.dao.IBasicDao;
import com.haois.mp.database.module.common.daomain.UserToken;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface MpUserTokenMapper extends IBasicDao<UserToken, String> {

    List<UserToken> findByUserId(@Param("userId") String userId);

    UserToken findByOpenId(@Param("openId") String openId);

    UserToken findByAccessToken(
            @Param("accessToken") String accessToken);

    List<UserToken> findAllByAccessToken(
            @Param("accessToken") String accessToken);

    int deleteByOpenId(@Param("openId") String openId);

    int deleteByUserId(@Param("userId") String userId);

    int deleteByAccessToken(@Param("accessToken") String openId);

    long findWxUserTokenCount();

}
